<?php

/*
 * This file is create for storing name of table, and field.
 * 
 */

if (!function_exists('table')) {

    function table($key) {
        // Tables' name
        $table['tbl_users'] = 'tbl_users';
        $table['tbl_positions'] = 'tbl_positions';
        $table['tbl_communes'] = 'tbl_communes';
        $table['tbl_news'] = 'tbl_news';
        $table['tbl_districts'] = 'tbl_districts';
        $table['tbl_provices'] = 'tbl_provices';
        $table['tbl_locations'] = 'tbl_locations';
        $table['tbl_houses'] = 'tbl_houses';
        $table['tbl_streets'] = 'tbl_streets';
        $table['tbl_languges'] = 'tbl_languges';
        $table['tbl_contents'] = 'tbl_contents';
        $table['tbl_categories'] = 'tbl_categories';

        if (array_key_exists($key, $table)) {
            return $table[$key];
        } else {
            return NULL;
        }
    }

}

if (!function_exists('field')) {

    function field($key) {
        // Fields' name
        $field['use_id'] = 'use_id';
        $field['use_first_name'] = 'use_first_name';
        $field['use_last_name'] = 'use_last_name';
        $field['use_gender'] = 'use_gender';
        $field['use_phone'] = 'use_phone';
        $field['use_email'] = 'use_email';
        $field['use_password'] = 'use_password';
        $field['use_token'] = 'use_token';

        $field['pos_id'] = 'pos_id';
        $field['pos_title'] = 'pos_title';
        $field['pos_is_enable'] = 'pos_is_enable';

        $field['com_id'] = 'com_id';
        $field['com_name'] = 'com_name';
        $field['com_border'] = 'com_border';
        $field['com_des'] = 'com_des';

        $field['dis_id'] = 'dis_id';
        $field['dis_name'] = 'dis_name';
        $field['dis_border'] = 'dis_border';
        $field['dis_des'] = 'dis_des';

        $field['pro_id'] = 'pro_id';
        $field['pro_name'] = 'pro_name';
        $field['pro_border'] = 'pro_border';
        $field['pro_des'] = 'pro_des';

        $field['loc_id'] = 'loc_id';
        $field['loc_title'] = 'loc_title';
        $field['loc_email'] = 'loc_email';
        $field['loc_url'] = 'loc_url';
        $field['loc_let_long'] = 'loc_let_long';
        $field['loc_date'] = 'loc_date';
        $field['loc_is_approve'] = 'loc_is_approve';
        $field['loc_is_paid'] = 'loc_is_paid';

        $field['hou_id'] = 'hou_id';
        $field['hou_name'] = 'hou_name';
        $field['hou_des'] = 'hou_des';

        $field['str_id'] = 'str_id';
        $field['str_name'] = 'str_name';
        $field['str_border'] = 'str_border';
        $field['str_des'] = 'str_des';

        $field['lan_id'] = 'lan_id';
        $field['lan_name'] = 'lan_name';
        $field['lan_code'] = 'lan_code';

        $field['con_id'] = 'con_id';
        $field['con_des'] = 'con_des';
        $field['con_home'] = 'con_home';
        $field['con_about'] = 'con_about';
        $field['con_contact'] = 'con_contact';
        $field['con_product_service'] = 'con_product_service';

        $field['cat_id'] = 'cat_id';
        $field['cat_title'] = 'cat_title';
        $field['cat_des'] = 'cat_des';
        $field['cat_enable'] = 'cat_enable';

        $field['new_id'] = 'new_id';
        $field['new_title'] = 'new_title';
        $field['new_des'] = 'new_des';
        $field['new_date'] = 'new_date';
        $field['new_is_approve'] = 'new_is_approve';

        if (array_key_exists($key, $field)) {
            return $field[$key];
        } else {
            return NULL;
        }
    }

}